<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script>

<fmt:message key="tipotransacao.titulo.tamanho" var="tipotransacao_tamanho" />

<script type="text/javascript">

$("#${param.formName}").validate({
	rules: {
		"tipoTransacao.titulo": {
			required: true,
			minlength: 2,
			maxlength: 20
		}
	},
	
	messages: {
		"tipoTransacao.titulo": {
			required: "${tipotransacao_tamanho}",
			minlength: "${tipotransacao_tamanho}",
			maxlength: "${tipotransacao_tamanho}"
		}
	},

	highlight: function (element) {
		$(element).addClass('error').removeClass('error');
    },
	
	success: function (element) {
		$(element).removeClass('error');
    }
});

</script>